package com.florent37.runtimepermission3;

import ohos.agp.components.Text;
import ohos.app.Context;
import ohos.app.dispatcher.TaskDispatcher;

public class AppendText {
    public static void appendText(Context context, Text textView, String text){
        TaskDispatcher uiTaskDispatcher = context.getUITaskDispatcher();
        uiTaskDispatcher.asyncDispatch(new Runnable() {
            @Override
            public void run() {
                textView.setText(textView.getText()+"\n"+text);
            }
        });

    }
}
